package com.frxuexi.shop2307.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.frxuexi.lib_base.entity.TypeShopBeanItem
import com.frxuexi.shop2307.R


class TypeOneAdapter:BaseQuickAdapter<TypeShopBeanItem,BaseViewHolder>(R.layout.item_type_one) {
    override fun convert(helper: BaseViewHolder, item: TypeShopBeanItem) {
        val tv = helper.getView<TextView>(R.id.type_one_name)
        tv.apply {
            setText(item.name)
            if(item.isCheck){
                setBackgroundResource(com.frxuexi.lib_base.R.drawable.shape_btn_pink)
                setTextColor(context.getColor(com.frxuexi.lib_base.R.color.redfont))
            }else{
                setBackgroundResource(com.frxuexi.lib_base.R.color.background)
                setTextColor(context.getColor(com.frxuexi.lib_base.R.color.darkgray))
            }
        }
    }
}